<?php
use backend\assets\AgentAsset;
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;

AgentAsset::register($this);
$this->registerJsFile("@web/system/financial/cashier/cashrefund.js",['position'=>$this::POS_END]);
?>
<style>
	.main{ padding: 20px 20px;}
	.context{ margin-top: 50px;}
	input[type="text"] {width: 256px;height: 34px;}
	 .ok, .rest{background-color: #fe7b9d;color: #fff;border-radius: 5px;padding: 5px 31px;}
	 .rest{background-color: #a4a9ad;}
	.myclass{ top: 5px;}
</style>
<div class="main">
	<div class="hide"><iframe name='send_post' id='send_post'></iframe></div>
	<?php ActiveForm::begin(['options'=>['target'=>'send_post','name'=>'register'],'action'=>Url::toRoute(['financial/cashier','action'=>'cashrefund'])])?>
	  <div class="context" style="width: 80%; margin: 25px auto;">
	    <label style="margin-right: 20px;">退款金额</label> <input type="text" class="" name="amount">
	    <input type="hidden" name="member_id" value="<?=$member_id?>" />
	  </div>
	  <div class="text-center" style="margin-top: 40px;">
		  <span class="btnBg" style="width: 92px; height: 32px;line-height: 32px;">
			  <input type="submit" value="确定" style="display: inline-block; width: 100%; background: 0; border: 0 ;padding: 0" /></span>
		  <span class="btnBg bg_rest ml20" style="width: 92px; height: 32px;line-height: 32px;">
			 <input type="reset" value="取消"  class="rest" style="display: inline-block; width: 100%; background: 0; border: 0;padding: 0"/></span>
	  </div>
	<?php ActiveForm::end()?>

</div>
<?php $this->beginBlock('js_index_end') ?>
$('form[name="register"]').validator({
focusCleanup: true,
stopOnError:false,
//debug: true,
timely: 2,
//自定义规则（PS：建议尽量在全局配置中定义规则，统一管理）
rules: {
length: [/^[0-9]\d*(\.\d+)?$/, '请输入大于或等于0的数字！']
},
msgClass: "n-bottom myclass",
fields: {
'amount': 'required; length;'
}
});
$(function(){
var index = parent.layer.getFrameIndex(window.name);
parent.layer.iframeAuto(index);
$('input[type="reset"]').click(function(){
parent.layer.close(index);
})
})
<?php $this->endBlock() ?>
<?php $this->registerJs($this->blocks['js_index_end'], $this::POS_END); ?>


